
public class Robot {
	
	public Robot(TestInterface  machine) {
			this.machine =machine;
	}
	
	TestInterface machine = null;
	
	
	public TestInterface getMachine() {
		return machine;
	}


	public void setMachine(TestInterface machine) {
		this.machine = machine;
	}


	public void startMachine()
	{
		machine.test();
	}
	
	
	public static void main(String[] args) {
		
		TestInterface samsung = new Samsung();
		Robot robot = new Robot(samsung);
		robot.startMachine();
		
		robot.setMachine(new Whirlpool());
		robot.startMachine();
//		robot.startMachine(new Whirlpool());
//		robot.setMachine(new Whirlpool());
		
		
//		Samsung s = new Samsung();
//		s.test();
//		
//		TestInterface s2 = s;
//		
//		TestInterface s1 = new Samsung();
//		s1.test();
//		
//		s1 = new Whirlpool();
//		s1.test();
		
	}
}
